<?php

namespace App\Models;

use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Eloquent\SoftDeletes;

class EquipmentModel extends BaseModel
{
    /**ruan shan chu deleted_at 软删除 */
    //use SoftDeletes;

    /**
     * Undocumented variable
     *
     * @var string
     */
    protected $table = 'equipment';
    protected $dates = ['deleted_at'];


    /**
     * 表明模型是否应该被打上时间戳
     *
     * @var bool
     */
    public $timestamps = true;

    /**
     * 获取充电站，充电桩数量
     *
     * @param [type] $sid
     * @return void
     */
    public static function GetEqNum($sid)
    {
        $eq_num = self::where('station_id', $sid)->count();
        return $eq_num;
    }


    /**
     * 获取充电站下充电桩列表
     *
     * @param [type] $sid
     * @return void
     */
    public static function GetEqList($sid)
    {
        $eqList = self::where('station_id', $sid)->get();
        return $eqList;
    }
}
